package com.boyunv.bridge.example01;

/*
 *@description  代理类
 *
 *@author boyunv
 *@create 2023/7/2 9:20
 *@version 1.0
 */

public class UserDaoProxy implements IUserDao{

    private  IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    public void save() {
        //扩展额外的功能
        System.out.println("开启事务");
        target.save();
        System.out.println("关闭事务");
    }
}
